package database

import (
	"goblog/internal/settings"
	"gorm.io/driver/mysql"
	"gorm.io/gorm"
)

func InitMySQL() (*gorm.DB, error) {
	return gorm.Open(mysql.Open(settings.Cfg.DB1.DSN()), &gorm.Config{
		DisableForeignKeyConstraintWhenMigrating: true,
	})
}
